package br.progweb.webapp.controller;

import br.progweb.webapp.service.GrupoManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * User: luiza
 * Date: 09/09/12
 * Time: 17:13
 * To change this template use File | Settings | File Templates.
 */

@Controller
public class GrupoController {
// ------------------------------ FIELDS ------------------------------

    @Autowired
    GrupoManager grupoManager;

// -------------------------- OTHER METHODS --------------------------

    @RequestMapping("/grupos*")
    public String execute(ModelMap model) {
        model.addAttribute("grupoList", grupoManager.getGrupos());
        return "grupoList";
    }
}
